﻿@{
    ViewBag.Title = "充值";
    Layout = "~/Views/Shared/_LayoutFore.cshtml";
}
@section style{
   
}
@section script{
    <script type="text/javascript">
        function chongzhi() {
            if ($("#sftDepositId").val() == null || $("#sftDepositId").val() == "") {
                $.dialog.alert("请先开通盛付通账号", function () {
                    window.location.href = "/Account/PersonalCertification";
                });
                return;
            }
            if ($("#sftOrderAmount").val() == "") {
                $.dialog.alert("请填写充值金额");
                return;
            }
            if ($("#sftOrderAmount").val() < 10) {
                $.dialog.alert("最低充值10元");
                return;
            }

            var url = "url:/Account/RechargeMiddlePpage?money=" + escape($("#sftOrderAmount").val()) + "&ip=" + $("#sftBuyerIp").val();
            $.dialog({
                content: url,
                width: '1200px',
                height: '800px',
                lock: true,
                background: '#000', /* 背景色 */
                opacity: 0.5,       /* 透明度 */
                drag: false,
                resize: false,
                close: function () {
                    parent.location.reload();
                    return true;
                }
            });
        }

        //根据时间查询
        function rechargeSearch() {
            $("#formRechargeTime").submit();
        }

        var util = {};
        var options = {
            listUrl: "@Url.Action("RechargeList")"
        };

        $(document).ready(function () {
            var gridopt = {
                url: options.listUrl,
                colModel: [
                        { display: '编号', name: 'Id', width: "5%", sortable: true, hide: true, align: 'left', iskey: true },
                        { display: '日期', name: 'CreateTime', width: "20%", sortable: false, hide: false, align: 'left' },
                        { display: '类型', name: 'Type', width: "10%", sortable: false, align: 'left', process: fromatType },
                        { display: '金额', name: 'InCome', width: "10%", sortable: false, align: 'left' },
                        { display: '支付方式', name: 'BankName', width: "10%", sortable: false, align: 'left' },
                        { display: '状态', name: 'Status', width: "10%", sortable: false, align: 'left', process: fromatStatus }
                ],
                sortname: "Id",
                sortorder: "DESC",
                title: false,
                rp: 14,
                usepager: true,
                showcheckbox: false
            };
            var xjgrid = new xjGrid("gridlist", gridopt);

            function fromatType(value, cell) {
                var ops = [];
                ops.push("充值");
                return ops.join("");
            }

            function fromatStatus(value, cell) {
                var ops = [];
                if (value == '1') {
                    return "成功";
                } else {
                    ops.push("失败");
                }
                return ops.join("");
            }

            $("#formRechargeTime").submit(function () {
                xjgrid.Query(this);
                return false;
            });
            
        });
    </script>
    <script src="~/Content/assets/DatePicker/WdatePicker.js"></script>
}




<div class="RightContrent">
    <div style="margin-left: 50px; margin-right: 50px;">

        <div class="tab-content">
            <div class="line10"></div>
            <div class="line10"></div>
            <div class="tab_title">@ViewBag.Title</div>
            <div class="tab-content">
                <div style="width: 16px; height: 12px; float: left;">
                    <img src="~/Content/Images/leftarraw.png" />
                </div>
            </div>
            
            <div class="tab-content_border">
                <form id="sftRechargeForm" >
                    <input type="hidden" id="sftDepositId" value="@ViewBag.sftDepositId"/>
                    <input type="hidden" id="sftBuyerIp" value="@ViewBag.IP"/>
                    <dl>
                        <dt>充值金额：</dt>
                        <dd>
                            <input id="sftOrderAmount" onkeyup="this.value=this.value.replace(/[^\d]/g,'')" onafterpaste="this.value=this.value.replace(/[^\d]/g,'')" maxlength="13" type="text" class="input normal" name="OrderAmount" style="height: 25px; width: 120px;" />&nbsp;
                            <button type="button" id="btnSftRecharge" class="btn" style="height: 35px;" onclick="chongzhi()">充值</button>
                        </dd>
                    </dl>
                </form>

                   <div class="listTips">
                            <p style="color: red; padding: 20px;">
                                温馨提示：<br /> 
                                 最低充值10元
                                全局金服“严禁洗钱、信用卡套现、虚假交易等行为，一经发现确认，将终止该账户使用。
                            </p>
                        </div> 
                
                 <div class="line10"></div>
                <div class="toolbar-wrap">
                    <div id="floatHead1" class="toolbar">
                        <div class="r-list">
                <form action="@Url.Action("RechargeList")" method="POST" id="formRechargeTime">
                    <div style="text-align: center; padding-top: 50px">
                        从<input type="text" name="Sdate" onclick="WdatePicker()" class="input normal" placeholder="开始时间" />
                        到<input type="text" name="Edate" onclick="WdatePicker()" class="input normal" placeholder="结束时间" />
                        &nbsp; &nbsp;
                        <input type="button" value="查询" class="btn" onclick="rechargeSearch()" />
                            </form>
                        </div>
                    </div>
                    </div>
                <div id="gridlist" style="margin-top:20px;"></div>
            </div>
        </div>
    </div>
</div>
